home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / GUICtrlCreateDate.au3 < prev    next >
Text File  |  2007-09-08  |  1KB  |  51 lines

  1. ; example1
  2. #include <GUIConstants.au3>
  3.  
  4. GUICreate ( "My GUI get date", 200,200,800,200)
  5. $date=GUICtrlCreateDate ("1953/04/25", 10,10,185,20 )
  6. GUISetState ()
  7.  
  8. ; Run the GUI until the dialog is closed
  9. Do
  10.     $msg = GUIGetMsg()
  11. Until $msg = $GUI_EVENT_CLOSE
  12.  
  13. MsgBox(0,"Date",GUICtrlRead($date))
  14. GUIDelete()
  15.  
  16. ; example2
  17. #include <GUIConstants.au3>
  18.  
  19. GUICreate("My GUI get time")
  20. $n=GUICtrlCreateDate ( "", 20, 20, 100, 20, $DTS_TIMEFORMAT) 
  21. GUISetState ()
  22.  
  23. ; Run the GUI until the dialog is closed
  24. Do
  25.     $msg = GUIGetMsg()
  26. Until $msg = $GUI_EVENT_CLOSE
  27.  
  28. MsgBox(0,"Time", GUICtrlRead($n))
  29. GUIDelete()
  30.  
  31. ; example3
  32. #include <GUIConstants.au3>
  33.  
  34. GUICreate ( "My GUI get date", 200,200,800,200)
  35. $date = GUICtrlCreateDate ("1953/04/25", 10,10,185,20 )
  36.  
  37. ; to select a specific default format
  38. If @UNICODE Then
  39.     $DTM_SETFORMAT = 0x1032
  40. Else
  41.     $DTM_SETFORMAT = 0x1005
  42. Endif
  43.  $style = "yyyy/MM/dd HH:mm:s"
  44. GuiCtrlSendMsg($date, $DTM_SETFORMAT, 0, $style)
  45.  
  46. GuiSetState()
  47. While GuiGetMsg() <> $GUI_EVENT_CLOSE
  48. WEnd
  49.  
  50. MsgBox(0,"Time", GUICtrlRead($date))
  51.